// Copyright 2012-present OSBI Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

.sku-progress-indicator {
  position: fixed;
  z-index: 9999;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 1;
  background-color: $saiku-color-secondary;
  transition: opacity cubic-bezier(0.4, 0, 0.2, 1) 436ms;
  pointer-events: none;
  &.sku-available {
    opacity: 0;
  }
}

.sku-logo-frame {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 98%;
  animation: fadein 436ms;
}

.sku-logo-frame-img {
  width: 100px;
  height: 100px;

  align-self: center;
}

.sku-progress-indicator-head {
  position: relative;
  overflow: hidden;
  height: 4px;
  background-color: #ccc;
}

.sku-progress-indicator {
  .sku-first-indicator,
  .sku-second-indicator {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: $saiku-color;
    transform: scaleX(0);
    transform-origin: left center;
  }

  .sku-first-indicator {
    animation: first-indicator 2000ms linear infinite;
  }

  .sku-second-indicator {
    animation: second-indicator 2000ms linear infinite;
  }

  .sku-logo {
    animation: App-logo-spin infinite 20s linear;

    align-self: center;
  }
}

@keyframes App-logo-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes first-indicator {
  0% {
    transform: translate(0%) scaleX(0);
  }

  25% {
    transform: translate(0%) scaleX(0.5);
  }

  50% {
    transform: translate(25%) scaleX(0.75);
  }

  75% {
    transform: translate(100%) scaleX(0);
  }

  100% {
    transform: translate(100%) scaleX(0);
  }
}

@keyframes second-indicator {
  0% {
    transform: translate(0%) scaleX(0);
  }

  60% {
    transform: translate(0%) scaleX(0);
  }

  80% {
    transform: translate(0%) scaleX(0.6);
  }

  100% {
    transform: translate(100%) scaleX(0.1);
  }
}
